{extend name='admin@public/content'}

{block name="content"}
<form autocomplete="off" onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='form-horizontal layui-form padding-top-20'>
    <input type="hidden" name="uid" value="{$vo.uid}">
    <div class="form-group">
        <label class="col-sm-2 control-label">所属用户</label>
        <div class='col-sm-8'>
            <input disabled value="{:widget('Mkg/getUsername', ['id' => $vo.uid])}" class="layui-input">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">所属圈子分类</label>
        <div class='col-sm-8'>
            <input disabled value="{:widget('Mkg/getQcate', ['id' => $vo.q_cate_id])}" class="layui-input">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label label-required">图片</label>
        <div class='col-sm-8'>
            <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                <thead>
                <tr>
                    <td>图片</td>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td class="text-top">
                        <input type="hidden" name="image" value="{$vo.image|default=''}">
                        <script>$('[name=image]').uploadMultipleImage()</script>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">内容</label>
        <div class='col-sm-8'>
            <textarea class="layui-textarea" name="content">{$vo.content|default=""}</textarea>
        </div>
    </div>

    <div class="hr-line-dashed"></div>
    <style>
        .pin-title{
            color: #333;
            font-size: 14px;
        }
    </style>
    <div class="pin-title" style="margin-bottom: 20px"><span>评论区</span></div>

    <table class="layui-table" lay-skin="line">
        <thead>
        <tr>
            <th>所属用户(昵称+账号)</th>
            <th>评论内容</th>
            <th>回复时间</th>
            <th>经纬度</th>
            <th>所在地址</th>
        </tr>
        </thead>
        <tbody>
        {volist name="pinglun" id="vo"}
        <tr>
            <td>
                <img src="{$vo.image}" alt="" width="40px" height="40px">
                {$vo.nickname}+{$vo.username}
                {if condition="$vo.huifu['username']"}
                <span style="color: blue;padding: 0 20px">回复</span>
                    <img src="{$vo.huifu['image']}" alt="" width="40px" height="40px">
                    {$vo.huifu['nickname']}+
                    {$vo.huifu['username']}
                {/if}
            </td>
            <td>{$vo.content}</td>
            <td>{$vo.create_at|format_datetime|raw}</td>
            <td>{$vo.h_jinwei}</td>
            <td>{$vo.h_address}</td>
        </tr>
        {/volist}
        </tbody>
    </table>


    <!--{empty name='pinglun'}-->
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    <!--{/empty}-->

    <div class="pin-title" style="margin: 20px 0"><span>点赞区</span></div>
    <table class="layui-table" lay-skin="line">
        <thead>
        <tr>
            <th>所属用户(昵称+账号)</th>
            <th>点赞时间</th>
            <th>经纬度</th>
            <th>所在地址</th>
        </tr>
        </thead>
        <tbody>
        {volist name="dianzan" id="vo"}
        <tr>
            <td>
                <img src="{$vo.image}" alt="" width="40px" height="40px">
                {$vo.nickname}+{$vo.username}
            </td>
            <td>{$vo.z_create_at|format_datetime|raw}</td>
            <td>{$vo.z_jinwei}</td>
            <td>{$vo.z_address}</td>
        </tr>
        {/volist}
        </tbody>
    </table>


    <!--{empty name='dianzan'}-->
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    <!--{/empty}-->


    <div class="hr-line-dashed"></div>


    <div class="col-sm-7 col-sm-offset-2">
        <div class="layui-form-item text-center">
            {if !empty($vo.id)}<input type="hidden" name="id" value="{$vo.id}">{/if}
            <button class="layui-btn" type="submit">禁止</button>
            <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">返回</button>
        </div>
    </div>

    <script>window.form.render();</script>

    <script>
        /*! 实例富文本编辑器  */
        require(['ckeditor'], function () {
            window.createEditor('[name="contents"]', {height: 500});
        });
    </script>
</form>
{/block}